<?php

namespace common\behavior\CommonMessagePushing;

use Webman\Stomp\Client;

/**
 * 任务返修行为 消息通知
 */
class TaskRepairV2Behavior
{
    /**
     * @param $params
     * @return void
     */
    public function run($params)
    {
        $data = [
            'source_user_id' => $params['operator'],
            'time' => $params['time'],
            'source_id' => $params['need_repair_task_id'],
            'source_module_code' => 'task',
            'category' => 'task_repair',
            'receiver' => [],
            'receiver_cc' => [],
        ];
        try {
            trace("common task repair push behavior" . request()->getUnionUserId(), 'DEBUG');
                Client::send('common_message_pushing', build_queue_data_with_xu($data));
        } catch (\Throwable $e) {
            trace(format_exception_info($e), 'ERR');
        }
        return;
    }
}
